package com.promote.Node;


import com.promote.algorithm.IsPalindrome;

/**
 * @ClassName OperNode
 * Description
 * @Author LiZiHao
 * Date 2023/8/29 11:05
 * @Version 1.0
 **/
public class OperatorNode {

    public class ListNode {
        int val;
        ListNode next;

        ListNode() {
        }

        ListNode(int val) {
            this.val = val;
        }

        ListNode(int val, ListNode next) {
            this.val = val;
            this.next = next;
        }
    }

    public int getListLength(ListNode head) {
        int length = 0;
        ListNode node = head;
        while (node != null) {
            length++;
            node = node.next;
        }

        return length;
    }


}
